<template>
	<component :is="component" :data="data" :column="column" :index="index"></component>
</template>

<script setup>
import { computed } from "vue"

import Vdefault from "./default/index.vue"
import Vimage from "./image/index.vue"
import Vvideo from "./video/index.vue"
import Vswitch from "./switch/index.vue"

const props = defineProps({
	column: {
		type: Object,
	},
	data: {},
	index: {
		type: Number,
	},
})
const component = computed(() => {
	switch (props.column.type) {
		case "image":
			return Vimage
		case "video":
			return Vvideo
		case "switch":
			return Vswitch
		default:
			return Vdefault
	}
})
</script>
